import { request } from '@/utils/request';
import { RequestEnum } from '@/enums/httpEnum';

export const attractionsApi = {
  attractionsList: '/attractions/list',
  attractionsDetail: '/attractions/detail',
  attractionsAdd: '/attractions/add',
  attractionsUpdate: '/attractions/update',
  attractionsDelete: '/attractions/delete',
  attractionsEnabled: '/attractions/enabled',
} as const;

export const createAttractions = (data: API.CreateAttractionsParams) => {
  return request({
    url: attractionsApi.attractionsAdd,
    method: RequestEnum.POST,
    data,
  });
};

export const updateAttractions = (data: API.UpdateAttractionsParams) => {
  return request({
    url: attractionsApi.attractionsUpdate,
    method: RequestEnum.PUT,
    data,
  });
};

export const deleteAttractions = (params: { id: number }) => {
  return request({
    url: attractionsApi.attractionsDelete,
    method: RequestEnum.DELETE,
    params,
  });
};

export const enabledAttractions = (params: { id: number }) => {
  return request({
    url: attractionsApi.attractionsEnabled,
    method: RequestEnum.POST,
    params,
  });
};
